package com.example.demo.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@ResponseBody //返回的使页面不是文本
public class LogController {

    //获取日志对象
    private static final Logger log = LoggerFactory.getLogger(LogController.class);

    //打印日志
    @RequestMapping("/hi")
    private void printLog() {
        log.error("这是一个error");
    }

}

